#ifndef ROBOTCONTROLLER_H
#define ROBOTCONTROLLER_H

class SystematicRobot;

/**
 *  The RobotController class controls robot subsystems and other robot controllers.
 *  
 *  To use it, create subclasses that override ActivateImpl, Deactivate Impl, Periodic, and Continuous.
 *  
 *  All controllers must be added to the Systematic robot.
 *  Teleop and autonomous controllers should be created and added with their respective set functions.
 *  They will be activated at the correct time, and can activate other controllers as needed.
 *  
 *  Controllers other than autonomous and teleop must be activated and deactivated by these
 *  two main controllers.
 *  
 *  Testing shows this class works.
 */
class RobotController
{
	// Befriend our robot class so it can call our functions.
	friend class SystematicRobot;
	
	public:
		RobotController();
		virtual ~RobotController();
		bool GetIsActive() const;
		void Activate();
		void Deactivate();
	protected:
		virtual void HandleActivate();
		virtual void HandleDeactivate();
		virtual void HandlePeriodic();
		virtual void HandleContinuous();
		virtual void HandleAddedToRobot(SystematicRobot &robot);
	private:
		bool m_isActive;
};

#endif // #ifndef ROBOTCONTROLLER_H 
